﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Akso.Infrastructure.Data.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.Entities
{
    /// <summary>
    /// 供应商实体,带审计，带软删除。
    /// </summary>
    [Table("Vendors")]//可以修改为不同的数据库表名
    public class Vendor : FullAuditedEntity<Guid>
    {
        public const int MaxNameLength = 50;
        public const int MaxAddressLength = 150;
        public const int MaxContactLength = 50;
        public const int MaxContactTelephoneLength = 50;
        public const int MaxContactMobileLength = 50;

        [Required]
        [Column("Name")]
        [MaxLength(MaxNameLength)]
        public virtual string Name { get; set; }
        [MaxLength(MaxAddressLength)]
        public virtual string Address { get; set; }
        [MaxLength(MaxContactLength)]
        public virtual string Contact { get; set; }
        [MaxLength(MaxContactTelephoneLength)]
        [DataType(DataType.PhoneNumber)]
        public virtual string ContactTelephone { get; set; }
        [MaxLength(MaxContactMobileLength)]
        [DataType(DataType.PhoneNumber)]
        public virtual string ContactMobile { get; set; }
        [DecimalPrecision(18,4)]
        public virtual Nullable<decimal> TotalCost { get; set; }
    }
}
